package com.yumijinfu.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;

import com.yumijinfu.R;
import com.yumijinfu.base.BaseActivity;
import com.yumijinfu.mian.MainActivity;


/**
 *
 * yihuangxing 启动页
 */
public class WeclomeActivity extends BaseActivity {
    private final long TIME = 1000;

    private boolean flag;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_weclome);
    }

    @Override
    protected void initTitle() {

        flag = (Boolean) mpreferencesUtils.get(WeclomeActivity.this, "first", false);

    }

    @Override
    protected void initView() {


        //
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {

                if(!flag){
                    startActivity(new Intent(WeclomeActivity.this, SplashActivity.class));
                    finish();
                }else {

                    startActivity(new Intent(WeclomeActivity.this,MainActivity.class));
                    overridePendingTransition(R.anim.in_from_right,
                            R.anim.out_to_left);
                    finish();
                }


            }
        },TIME);

    }

    @Override
    protected void setData() {

    }

    @Override
    public void widgetClick(View v) {

    }
}
